package com.brucekong.slm.mapper.user;

import com.brucekong.slm.model.user.UserDomain;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {

    int insert(UserDomain record);

    int delete(String userId);

    int update(@Param("userName") String userName, @Param("password") String password);

    UserDomain select(String userId);

    // 加上 @Param 便于在mapper.xml中使用if test
    List<UserDomain> selectUsers(@Param("userId") String userId);

    List<UserDomain> selectUsers();

    UserDomain getUserByUserName(String userName);

    UserDomain getUserWithoutPasswordByUserName(String userName);

    UserDomain getUserWithoutPasswordByLoginId(String userId);

    void register(String userName, String password);
}
